package com.hfb.mashibing.alip8.spring.shardingsphere.controller;

import com.hfb.mashibing.alip8.spring.shardingsphere.service.ManyDataSourceService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Slf4j
@RestController
@RequestMapping("many")
public class ManyDataSourceController {

    @Autowired
    private ManyDataSourceService manyDataSourceService;

    @RequestMapping(value = "insert")
    public ResponseEntity insert(Object o){
        log.debug("insert->()");

        return new ResponseEntity(manyDataSourceService.insert(o), HttpStatus.OK);
    }
}
